function [y] = escape_data (x, threshold)
l = length(x(:));
i=1;
k = i;
bit_count = 0;
  while (i<=l)
             if (x(i) > threshold)
                   while (floor(x(i)/threshold) ~= 0)
                       y(k) = threshold;
                       k= k+1;
                       x(i) = x(i) - threshold;
                   end
                   y(k)= x(i);
                   k = k+1;
             else
                 y(k) = x(i);
                 k = k+1;
             end
          i = i+1;        
  end
end